﻿using System;
using System.Web.Security;
using System.Web.UI.WebControls;


namespace RepairTracker
{
    public partial class login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void loginMain_Authenticate(object sender, AuthenticateEventArgs e)
        {
            int userPermission;
            userPermission=Entity.UserAuthenticate(loginMain.UserName,loginMain.Password);
            if (userPermission!=0)
            {
                
                //UserInfo.UserName = loginMain.UserName;
                //UserInfo.Permission = userPermission;
                //e.Authenticated = true;
                FormsAuthentication.RedirectFromLoginPage(loginMain.UserName+"@"+userPermission.ToString(),false);
            }
        }

        
       
    }
}